#pragma once 
#include "protocol.hpp"
class MyCal
{
public:
    MyCal(){}
    Response Cal(const Request& req){
        Response rsp;
        switch(req.oper()){
            case '+':
            rsp.SetResult(req.X()+req.Y());
            rsp.SetStatus(OK);
            break;
            case '-':
            rsp.SetResult(req.X()-req.Y());
            rsp.SetStatus(OK);
            break;
            case '*':
            rsp.SetResult(req.X()*req.Y());
            rsp.SetStatus(OK);
            break;
            case '/':
            if (req.Y() != 0){
                rsp.SetResult(req.X()-req.Y());
                rsp.SetStatus(OK);
            }
            else
                rsp.SetStatus(ERROR_STATUS);
            break;  
            default:
                rsp.SetStatus(ERROR_STATUS);
            break;          
        }
        return rsp;
    }
    ~MyCal(){}
private:
};